﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace MedicalDB
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            string xmlFile = @"C:\Configurare.xml";
            XMLParser xmlParser = new XMLParser(xmlFile);
            Dictionary<string, string> namesForm = xmlParser.ExtractAttributePairs("Configurare", string.Empty, string.Empty, "name", "formula");

            if(namesForm["Limba"].Equals(string.Empty))
                Application.Run(new FormLimba());
            else
                Application.Run(new FormDBMedical(namesForm["Limba"], namesForm["ServerIP"],
                    namesForm["ServerPort"], namesForm["FTPIp"], namesForm["FTPUser"],
                    namesForm["FTPParola"], namesForm["FTPPort"]));

        }
    }
}
